<template>
  <el-container class="home-container">
    <el-header><!-- 头部区 -->
      <div>
        <span id="fontLogo">智能快递柜后台管理系统</span>
      </div>
      <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          id="indexMenu">
        <el-menu-item index="1" @click="shouye">首页</el-menu-item>
        <el-menu-item index="2" @click="expressList">会员</el-menu-item>
        <el-menu-item index="3" @click="goToMachine">柜机</el-menu-item>
        <el-menu-item index="4" @click="baoguo">包裹</el-menu-item>
        <el-menu-item index="5" @click="tiaozhuan">财务</el-menu-item>
        <el-menu-item index="6" @click="other">其他</el-menu-item>
      </el-menu>
      <div>
        <span id="fontName">{{this.name}}</span>
      </div>
    </el-header>
    <!-- 页面主体区域 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="210px" hight="100%">
        <el-menu
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">

          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span @click="expressList">快递员列表</span>
          </el-menu-item>
          <el-menu-item index="3">
            <i class="el-icon-menu"></i>
            <span slot="title" @click="expressAuth">快递员认证审核</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title" @click="expressMember">普通会员列表</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main>
        <div style="margin-left: 20px; margin-top: 20px">
 <span style="color: whitesmoke; text-align: left">
   会员管理/快递员审核认证/审核详情
</span>
        <div style="width: 1880px;background-color: whitesmoke; height: 1000px">
<!--          上半部分-->
          <div style="width: 100%; height: 40px; border-color: #181818;text-align: left">
            <span style="font-size: 20px; text-align: left;margin-left: 10px;margin-top: 10px">审核详情</span>
            <div style="margin-left: 1830px" @click="expressAuth">
              返回
            </div>
          </div>
          <div style="margin-top: 10px;background-color: whitesmoke;height: 250px;width: 100%;display: flex">
            <div style="width: 200px;height: 200px;background-color: antiquewhite;margin-top: 30px;margin-left: 30px">
              <el-image
                  style="width: 200px; height: 200px"
                  :src="form.photo"
                  :fit="fit"></el-image>
            </div>
            <div style="width: 1600px;height: 200px;margin-top: 30px;margin-left: 30px;display: flex">
              <div style="width: 500px;height: 100%;">
                  <div style="width: 100%;height: 65px;text-align: left;font-size: 18px">
                          <span style="margin-left: 20px;margin-top: 20px">ID： {{form.id}}</span>
                  </div>
                <div style="width: 100%;height: 65px;text-align: left;font-size: 18px">
                  <span style="margin-left: 20px;margin-top: 20px">手机号码：  {{form.phone}}</span>
                </div>
                <div style="width: 100%;height: 65px;text-align: left;font-size: 18px">
                  <span style="margin-left: 20px;margin-top: 20px">注册类型：  {{form.registrationType==1 ? '自主注册' : '后台创建'}}</span>
                </div>
              </div>
            </div>
          </div>
<!--          下半部分-->
          <div style="background-color: whitesmoke;width: 1880px;height: 100%" >

              <div style="text-align: left;margin-top: 30px">
                <div style="width: 300px;height: 60px;font-size: 20px;">
                 <span style="margin-left: 30px"> 审核类型: {{form.authType==1 ? '快递员认证' : '实名认证'}}</span>
                </div>
                <div style="width: 300px;height: 60px;font-size: 20px;" v-if="form.authType==1">
                  <span style="margin-left: 30px"> 快递公司: {{form.postCompany}}</span>
                </div>

                <div style="width: 300px;height: 60px;font-size: 20px;" v-if="form.authType==2">
                  <span style="margin-left: 30px"> 证件类型: {{form.documentType==1 ? '工牌/名片' : '身份证'}}</span>
                </div>
                <div style="width: 600px;height: 300px;font-size: 20px;margin-top: 20px"  v-if="form.authType==1">
                  <el-image
                      style="width: 600px; height: 300px"
                      :src="form.workCardImage"
                      :fit="fit"></el-image> 工牌或名片照片
                </div>


                <div style="width: 600px;height: 250px;font-size: 20px;margin-top: 20px" v-if="form.authType==2" >
                  <el-image
                      style="width: 600px; height: 250px"
                      :src="form.certificateImage"
                      :fit="fit"></el-image>   证件正面
                </div>

                <div style="width: 600px;height: 250px;font-size: 20px;margin-top: 20px;margin-top: 40px" v-if="form.authType==2">
                  <el-image
                      style="width: 600px; height: 250px"
                      :src="form.certificateHandImage"
                      :fit="fit"></el-image>    手持证件正面照
                </div>

                <h2 style="margin-top: 80px">审核详情</h2>
                <div style="width: 300px;height: 60px;font-size: 20px;">
                  <span style="margin-left: 30px"> 审核状态: {{form.statusa==1? '审核通过' : form.status==2? '待审核' :'已拒绝'}}</span>
                </div>
                <div style="width: 350px;height: 60px;font-size: 20px;">
                  <span style="margin-left: 30px"> 操作日期: {{form.passDate|format('yyyy-MM-dd hh:mm:ss')}}</span>
                </div>

                <div style="width: 300px;height: 60px;font-size: 20px;" v-if="form.statusa==3">
                  <span style="margin-left: 30px"> 拒绝原因中文: {{form.refuseCn}}</span>
                </div>
                <div style="width: 300px;height: 60px;font-size: 20px;"  v-if="form.statusa==3">
                  <span style="margin-left: 30px"> 拒绝原因英文: {{form.refuseEn}}</span>
                </div>

              </div>

          </div>
        </div>
      </div>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// import {listExpressList} from "@/api/expressList/expressList";
import axios from "axios";
export default {
  data() {
    return {
      form: {},
      activeName: 'first',
      phone:null,
    };
  },


  created() {
    this.id=this.$route.query.id;
    this.iid=this.$route.query.iid;
    this.getDetial();
  },


  methods: {
    // 页面跳转
    xitong(){
      this.$router.push(
          {path: "/OutSystems"}
      )
    },
    baoguo(){
      this.$router.push(
          {path: "/OutPackage"}
      )
    },
    notice() {
      this.$router.push(
          {path: "/HomePage"}
      )
    },
    //跳转其他页面
    other() {
      this.$router.push(
          {path: "/otherView"}
      )
    },
    tiaozhuan(){
      this.$router.push({
        path:'/zhanghuPage'
      })
    },
    goToMachine(){
      this.$router.push(
          {path: "/machineHome"}
      )
    },
    shouye(){
      this.$router.push(
          {path: "/"}
      )
    },
    expressMember(){
      this.$router.push(
          {path: "/expressMember"}
      )
    },
    // 页面跳转
    expressList(){
      this.$router.push(
          {path: "/expressList"}
      )
    },
    // 页面跳转
    expressAuth(){
      this.$router.push(
          {path: "/expressAuth"}
      )
    },
    // 获取详情信息
    getDetial(){
      axios.get('http://localhost:10020/expressList/getAuthDetialList?id='+this.id+'&iid='+this.iid).then(response =>{
        this.form = response.data;
        // 加载状态结束
        this.loading = false;
      });
    },


  },
  filters:{
    format(value,arg){
      function dateFormat(date, format) {
        if (typeof date === "string") {
          var mts = date.match(/(\/Date\((\d+)\)\/)/);
          if (mts && mts.length >= 3) {
            date = parseInt(mts[2]);
          }
        }
        date = new Date(date);
        if (!date || date.toUTCString() == "Invalid Date") {
          return "";
        }
        var map = {
          "M": date.getMonth() + 1, //月份
          "d": date.getDate(), //日
          "h": date.getHours(), //小时
          "m": date.getMinutes(), //分
          "s": date.getSeconds(), //秒
          "q": Math.floor((date.getMonth() + 3) / 3), //季度
          "S": date.getMilliseconds() //毫秒
        };
        format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
          var v = map[t];
          if (v !== undefined) {
            if (all.length > 1) {
              v = '0' + v;
              v = v.substr(v.length - 2);
            }
            return v;
          } else if (t === 'y') {
            return (date.getFullYear() + '').substr(4 - all.length);
          }
          return all;
        });
        return format;
      }

      return dateFormat(value,arg);

    }
  },
};
</script>

<style lang="less">
#app {
  margin-top: 0;
}

.home-container {
  height: 100%;
}

.el-header {
  background-color: #545c64;
  display: flex; //设置显示为flex布局
  justify-content: space-between; //设置为flex左右布局
  padding-left: 0; //左内边距为0（Logo贴左边）
  align-items: center; //元素上下居中（防止右边按钮贴上下边）
  color: #fff;
  font-size: 18px;

  > div {
    //内嵌的div样式
    display: flex;
    align-items: center; //Logo和文字上下居中
    #fontLogo {
      width: 200px;
      margin-left: 10px; //文字左侧设置间距，防止与Logo紧贴
    }
    #fontName {
      width: 120px;
      margin-right: 10px;
    }
  }
}

#indexMenu {
  width: 100%;
}

.el-menu {
  background-color: #545c64;
}

.el-aside {
  background-color: #545c64;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */
  overflow-x: hidden;
  overflow-y: auto;
}

.el-main {
  background-color: #eaedf1;
  height: 1000px;
}
</style>

